import axios from 'axios';

// 配置请求头
let request = axios.create({
  baseURL: "https://api.moguvet.com/c"
});

// 配置请求拦截器(自动携带token)
// interceptors拦截器
request.interceptors.request.use((config) => {
  config.headers = {
    Authorization: "Bearer " + localStorage.getItem("token"),
  };
  return config;
});

// 响应拦截器
request.interceptors.response.use((res) => res)

export default request;